package dubbo.consumer_one;

import java.io.IOException;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import dubbo.service.HelloService;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) throws IOException
    {
    	 //读取配置文件
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"dubbo-consumer.xml"});
        //获取在zookeeper注册的服务接口
        HelloService helloService = (HelloService)context.getBean("helloService");
        //调用接口
        System.out.println("HelloService = " + helloService.sayHello("ant"));
        //不让控制台消失，按任意键结束
        System.in.read();
    }
}
